﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSM.Lib.Protocol
{
	public class UserInfoReq : ProtocolReqBase
	{
		public UserInfoReq() : base(ProtocolWord.UserInfoReq) { }
		public override ProtocolBase Response(UserInfo ui)
		{
			return new UserInfoResp().Response(ui);
		}
	}

	public class UserInfoResp : ProtocolRespBase
	{
		public UserInfoResp() : base(ProtocolWord.UserInfoResp) { }
		public long UserID;
		public string NickName;
		public string TrueName;
		public DateTime Birthday;
		public Gender Gender;
		public string Email;
		public bool IsLogOff;
		public bool IsFreeze;

		public override ProtocolBase Response(object o)
		{
			UserInfo ui = o as UserInfo;
			UserInfoResp resp = new UserInfoResp();

			resp.UserID = ui.UserID;
			resp.NickName = ui.NickName;
			resp.TrueName = ui.TrueName;
			resp.Birthday = ui.Birthday;
			resp.Gender = ui.Gender;
			resp.Email = ui.Email;
			resp.IsLogOff = ui.IsLogoff;
			resp.IsFreeze = ui.IsFreeze;
				
			return resp;
		}
	}
}
